<#include "/macro.include"/>
<#include "/java_copyright.include">
<#assign className = table.className>   
<#assign classNameLower = className?uncap_first> 
package ${basepackage}.query.${moduleNameLower};


public class ${className}Query extends javacommon.base.BaseQuery implements java.io.Serializable {
	private static final long serialVersionUID = 54541558253146326L;
	<@generateFields/>
	<@generateProperties/>

	public String toString() {
		return org.apache.commons.lang.builder.ToStringBuilder.reflectionToString(this,org.apache.commons.lang.builder.ToStringStyle.DEFAULT_STYLE);
	}
	
}

<#macro generateFields>

	<#list table.columns as column>
	/** ${column.columnAlias} */
	<#if column.isDateTimeColumn    >
	private ${column.javaType} ${column.columnNameLower}Begin;
	private ${column.javaType} ${column.columnNameLower}End;
	private ${column.javaType} ${column.columnNameLower};
	<#else>
	private ${column.javaType} ${column.columnNameLower};
	</#if>
	</#list>

</#macro>

<#macro generateProperties>
	<#list table.columns as column>
	<#if column.isDateTimeColumn >
	public ${column.javaType} get${column.columnName}Begin() {
		return this.${column.columnNameLower}Begin;
	}
	
	public void set${column.columnName}Begin(${column.javaType} value) {
		this.${column.columnNameLower}Begin = value;
	}	
	
	public ${column.javaType} get${column.columnName}End() {
		return this.${column.columnNameLower}End;
	}
	
	public void set${column.columnName}End(${column.javaType} value) {
		this.${column.columnNameLower}End = value;
	}
	public ${column.javaType} get${column.columnName}() {
		return this.${column.columnNameLower};
	}
	
	public void set${column.columnName}(${column.javaType} value) {
		this.${column.columnNameLower} = value;
	}
	
	<#else>
	public ${column.javaType} get${column.columnName}() {
		return this.${column.columnNameLower};
	}
	
	public void set${column.columnName}(${column.javaType} value) {
		this.${column.columnNameLower} = value;
	}
	<#if (column.columnAlias?index_of("#")) gt -1>
  public String get${column.columnName}Enum() {
  	  return SafeUtils.getEnumStrValue(get${column.columnName}(),"${column.columnAlias?substring(column.columnAlias?index_of("#")+1)}");
	}
 </#if>	
    
	</#if>	
	</#list>
</#macro>



